#ifndef STRETCHYLAYOUT_H_
#define STRETCHYLAYOUT_H_

#include "UILayout.h"
#include "Point2d.h"
#include <map>

namespace Lame3d
{
	class StretchyLayout : public UILayout
	{
		public:
			StretchyLayout();
			~StretchyLayout();
			
			class Properties : public UILayoutProperties
			{
				public:
					Properties(const Point2d &uL, const Point2d &lR);
					~Properties();
					
					const Point2d& UpperLeft() const;
					const Point2d& LowerRight() const;
					
				protected:
					Point2d upperLeft;
					Point2d lowerRight;
			};
			
			void AddElement(UIElement *e, UILayoutProperties *props);
			void RemoveElement(UIElement *e);
			void Pack();
		
		protected:
			std::map<UIElement*, Properties*> properties;
			
			void align(UIElement *e, Properties *p);		
	};
}

#endif /*STRETCHYLAYOUT_H_*/
